﻿using System;

using System.Collections.Generic;
using System.Text;

namespace Silvermoon.OpenGL.Native
{
    public class OpenGlException : Exception
    {
        public uint ErrorId { get; private set; }
        public string GlMessage { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="OpenGlException"/> class.
        /// </summary>
        /// <param name="errorId">The error id.</param>
        /// <param name="message">The message.</param>
        public OpenGlException(uint errorId, string message)
            : base(message + ": " + errorId)
        {
            ErrorId = errorId;
            GlMessage = message;
        }

        public OpenGlException(string message)
            : base(message)
        {
            GlMessage = message;
            ErrorId = gl.GetError();
        }
    }

}
